package mh.demo.jdk.util.concurrent;

import mh.demo.PrintUtils;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchDemo {

    static CountDownLatch c = new CountDownLatch(2);

    public static void main(String[] args) throws InterruptedException {
        new Thread(() -> {
            PrintUtils.println("1");
            c.countDown();
            PrintUtils.println("2");
            c.countDown();
        }).start();
        c.await();
        PrintUtils.println("3");
    }
}
